import java.awt.*;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class TH0 extends Thread{
    public static ExecutorService service = Executors.newFixedThreadPool(4);
    int w;
    int h;

    public TH0(int w, int h) {
        this.w = w;
        this.h = h;
    }

    public  void main() {

        int i = 0;
        while (THI.b) {
            try {
                THI thi = new THI(++i,w,h);
                service.execute(thi);
                Thread.sleep(100); // 等待1秒
            } catch (Exception e) {
                e.printStackTrace();
            }

        }
        service.shutdown();
    }
    @Override
    public void run() {
        main();
    }
}
